package org.gruposp2p.aula.gwt.client.content;

import org.gruposp2p.aula.gwt.client.AulaApplication;
import org.gruposp2p.aula.gwt.client.AulaConstants;
import org.gruposp2p.aula.gwt.client.content.course.CoursePanelWidget;
import org.gruposp2p.aula.gwt.client.content.coursegroup.CoursegroupPanelWidget;
import org.gruposp2p.aula.gwt.client.content.student.StudentPanelWidget;
import com.google.gwt.i18n.client.Constants;
import com.google.gwt.user.client.ui.DecoratedTabPanel;
import com.google.gwt.user.client.ui.Widget;

public class AulaContentPanelManager {
	
	private AulaApplication aulaApplication;
	private AulaConstants constants;
	
	public static interface CwConstants extends Constants {	}
	
	public AulaContentPanelManager (AulaApplication aulaApplication) {
		this.aulaApplication = aulaApplication;
		this.constants = aulaApplication.getConstants();
	}	
	
	public final Widget createWidget() {
	    // Create a tab panel
	    DecoratedTabPanel tabPanel = new DecoratedTabPanel();
	    tabPanel.setWidth("100%");
	    tabPanel.setHeight("500px");
	    tabPanel.setStyleName("aulaTab");
	    //tabPanel.setAnimationEnabled(true);
	    StudentPanelWidget studentWidget = new StudentPanelWidget(aulaApplication);
	    CoursegroupPanelWidget coursegroupPanelWidget = new CoursegroupPanelWidget(aulaApplication);
	    CoursePanelWidget coursePanelWidget = new CoursePanelWidget(aulaApplication);
	    tabPanel.add(studentWidget, 
	    		studentWidget.getName());
	    tabPanel.add(coursegroupPanelWidget, 
	    		coursegroupPanelWidget.getName());	
	    tabPanel.add(coursePanelWidget, 
	    		coursePanelWidget.getName());
	    // Return the content
	    tabPanel.selectTab(0);
	    tabPanel.ensureDebugId("AulaContentPanelManager");
	    return tabPanel;
	}

}